home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / gnu / djgpp / contrib / dvx / inc / x11 / xaw / textsink.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-15  |  7.4 KB  |  240 lines

  1. /*
  2.  * $XConsortium: TextSink.h,v 1.5 89/11/01 17:28:26 kit Exp $
  3.  */
  4.  
  5. /***********************************************************
  6. Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
  7. and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  8.  
  9.                         All Rights Reserved
  10.  
  11. Permission to use, copy, modify, and distribute this software and its 
  12. documentation for any purpose and without fee is hereby granted, 
  13. provided that the above copyright notice appear in all copies and that
  14. both that copyright notice and this permission notice appear in 
  15. supporting documentation, and that the names of Digital or MIT not be
  16. used in advertising or publicity pertaining to distribution of the
  17. software without specific, written prior permission.  
  18.  
  19. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  20. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  21. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  22. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  23. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  24. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  25. SOFTWARE.
  26.  
  27. ******************************************************************/
  28.  
  29. #ifndef _XawTextSink_h
  30. #define _XawTextSink_h
  31.  
  32. /***********************************************************************
  33.  *
  34.  * TextSink Object
  35.  *
  36.  ***********************************************************************/
  37.  
  38. #include <X11/Object.h>
  39.  
  40. /* Resources:
  41.  
  42.  Name             Class        RepType        Default Value
  43.  ----             -----        -------        -------------
  44.  font                Font            XFontStruct *      XtDefaultFont
  45.  foreground          Foreground      Pixel              XtDefaultForeground
  46.  background          Background      Pixel              XtDefaultBackground
  47.  
  48. */
  49.  
  50. /* Class record constants */
  51.  
  52. extern WidgetClass textSinkObjectClass;
  53.  
  54. typedef struct _TextSinkClassRec *TextSinkObjectClass;
  55. typedef struct _TextSinkRec      *TextSinkObject;
  56.  
  57. typedef enum _XawTextInsertState {XawisOn, XawisOff} XawTextInsertState; /* POHC 91/04/08 */
  58.  
  59. /************************************************************
  60.  *
  61.  * Public Functions.
  62.  *
  63.  ************************************************************/
  64.  
  65. /*    Function Name: XawTextSinkDisplayText
  66.  *    Description: Stub function that in subclasses will display text. 
  67.  *    Arguments: w - the TextSink Object.
  68.  *                 x, y - location to start drawing text.
  69.  *                 pos1, pos2 - location of starting and ending points
  70.  *                              in the text buffer.
  71.  *                 highlight - hightlight this text?
  72.  *    Returns: none.
  73.  *
  74.  * This function doesn't actually display anything, it is only a place
  75.  * holder.
  76.  */
  77.  
  78. void XawTextSinkDisplayText(/* w, x, y, pos1, pos2, highlight */);
  79. /*
  80. Widget w;
  81. Position x, y;
  82. Boolean highlight;
  83. XawTextPosition pos1, pos2;
  84. */
  85.  
  86. /*    Function Name: XawTextSinkInsertCursor
  87.  *    Description: Places the InsertCursor.
  88.  *    Arguments: w - the TextSink Object.
  89.  *                 x, y - location for the cursor.
  90.  *                 staye - whether to turn the cursor on, or off.
  91.  *    Returns: none.
  92.  *
  93.  * This function doesn't actually display anything, it is only a place
  94.  * holder.
  95.  */
  96.  
  97. void XawTextSinkInsertCursor( /* w, x, y, state */ );
  98. /*
  99. Widget w;
  100. Position x, y;
  101. XawTextInsertState state;
  102. */
  103.  
  104. /*    Function Name: XawTextSinkClearToBackground
  105.  *    Description: Clears a region of the sink to the background color.
  106.  *    Arguments: w - the TextSink Object.
  107.  *                 x, y  - location of area to clear.
  108.  *                 width, height - size of area to clear
  109.  *    Returns: void.
  110.  *
  111.  * This function doesn't actually display anything, it is only a place
  112.  * holder.
  113.  */
  114.  
  115. void XawTextSinkClearToBackground (/* w, x, y, width, height */);
  116. /*
  117. Widget w;
  118. Position x, y;
  119. Dimension width, height;
  120. */
  121.  
  122. /*    Function Name: XawTextSinkFindPosition
  123.  *    Description: Finds a position in the text.
  124.  *    Arguments: w - the TextSink Object.
  125.  *                 fromPos - reference position.
  126.  *                 fromX   - reference location.
  127.  *                 width,  - width of section to paint text.
  128.  *                 stopAtWordBreak - returned position is a word break?
  129.  *                 resPos - Position to return.      *** RETURNED ***
  130.  *                 resWidth - Width actually used.   *** RETURNED ***
  131.  *                 resHeight - Height actually used. *** RETURNED ***
  132.  *    Returns: none (see above).
  133.  */
  134.  
  135. void XawTextSinkFindPosition(/* w, fromPos, fromx, width, stopAtWordBreak, 
  136.                  resPos, resWidth, resHeight */ );
  137. /*
  138. Widget w;
  139. XawTextPosition fromPos; 
  140. int fromx, width;            
  141. Boolean stopAtWordBreak;        
  142. XawTextPosition *resPos;    
  143. int *resWidth, *resHeight;        
  144. */
  145.  
  146. /*    Function Name: XawTextSinkFindDistance
  147.  *    Description: Find the Pixel Distance between two text Positions.
  148.  *    Arguments: w - the TextSink Object.
  149.  *                 fromPos - starting Position.
  150.  *                 fromX   - x location of starting Position.
  151.  *                 toPos   - end Position.
  152.  *                 resWidth - Distance between fromPos and toPos.
  153.  *                 resPos   - Acutal toPos used.
  154.  *                 resHeight - Height required by this text.
  155.  *    Returns: none.
  156.  */
  157.  
  158. void XawTextSinkFindDistance (/* w, fromPos, fromx, 
  159.                  toPos, resWidth, resPos, resHeight */);
  160. /*
  161. Widget w;
  162. XawTextPosition fromPos, toPos, *resPos;
  163. int fromx, *resWidth, *resHeight;
  164. */
  165.  
  166. /*    Function Name: XawTextSinkResolve
  167.  *    Description: Resloves a location to a position.
  168.  *    Arguments: w - the TextSink Object.
  169.  *                 pos - a reference Position.
  170.  *                 fromx - a reference Location.
  171.  *                 width - width to move.
  172.  *                 resPos - the resulting position.
  173.  *    Returns: none
  174.  */
  175.  
  176. void XawTextSinkResolve(/* w, pos, fromx, width, resPos */);
  177. /*
  178. Widget w;
  179. XawTextPosition pos;
  180. int fromx, width;
  181. XawTextPosition *resPos;
  182. */
  183.  
  184. /*    Function Name: XawTextSinkMaxLines
  185.  *    Description: Finds the Maximum number of lines that will fit in
  186.  *                   a given height.
  187.  *    Arguments: w - the TextSink Object.
  188.  *                 height - height to fit lines into.
  189.  *    Returns: the number of lines that will fit.
  190.  */
  191.  
  192. int XawTextSinkMaxLines(/* w, height */);
  193. /*
  194. Widget w;
  195. Dimension height;
  196. */
  197.  
  198. /*    Function Name: XawTextSinkMaxHeight
  199.  *    Description: Finds the Minium height that will contain a given number 
  200.  *                   lines.
  201.  *    Arguments: w - the TextSink Object.
  202.  *                 lines - the number of lines.
  203.  *    Returns: the height.
  204.  */
  205.  
  206. int XawTextSinkMaxHeight(/* w, lines */);
  207. /*
  208. Widget w;
  209. int lines;
  210. */
  211.  
  212. /*    Function Name: XawTextSinkSetTabs
  213.  *    Description: Sets the Tab stops.
  214.  *    Arguments: w - the TextSink Object.
  215.  *                 tab_count - the number of tabs in the list.
  216.  *                 tabs - the text positions of the tabs.
  217.  *    Returns: none
  218.  */
  219.  
  220. void XawTextSinkSetTabs(/* w, tab_count, tabs */);
  221. /*
  222. Widget w;
  223. int tab_count, *tabs;
  224. */
  225.                           
  226. /*    Function Name: XawTextSinkGetCursorBounds
  227.  *    Description: Finds the bounding box for the insert curor (caret).
  228.  *    Arguments: w - the TextSinkObject.
  229.  *                 rect - an X rectance containing the cursor bounds.
  230.  *    Returns: none (fills in rect).
  231.  */
  232.  
  233. void XawTextSinkGetCursorBounds(/* w, rect */);
  234. /*
  235. Widget w;
  236. XRectangle * rect;
  237. */
  238.  
  239. #endif /* _XawTextSrc_h -- DON'T ADD STUFF AFTER THIS #endif */
  240.